<template>
  <view
    class="content"
    :style="{
      'padding-top': height + 'px',
    }"
  >
    <view
      :style="{
        height: statusBarHeight + 'px',
      }"
    >
    </view>
    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#444444"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text">{{detail.title}}</view>
    </view>

    <view class="box" v-html="detail.content">
      <!-- <view class="box_title">1.如何开通会员？</view>
      <view class="box_text"
        >巴纳姆效应是指人们容易相信一种对于自己的笼统描述。即使这种描述十分模糊、空洞及普遍，人们还是确信这就是符合自己人格面貌的准确评价。“巴纳姆效应”产生的原因被认为是“主观验证”的作用。我们如果想要相信一件事，总可以搜集到各种各样支持自己的证据。就算是毫不相干的事情，我们还是可以找到一个逻辑让它符合自己的设想。蓝色是世界上最受欢迎的颜色，它往往会让人联想到水和天空。但是人们却不喜欢蓝色的食物，因为它会让人联想到变质。蓝色能让人在白天更加警觉和健康，在夜晚则会干扰睡眠。当你需要一种喜闻乐见的颜色时，蓝色是首选，但不能把食品设计成蓝色。</view
      > -->
    </view>

    <floatingBall></floatingBall>
  </view>
</template>
    
    <script>
import selectType from "@/components/selectType.vue";
export default {
  components: {
    selectType,
  },
  data() {
    return {
      statusBarHeight: 0,
      height: 0,
      detail:{},
      id:''
    };
  },
  onLoad(options) {
    this.id = options.id;
  },
  created() {
    this.getDetail()
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度
    this.statusBarHeight = statusBarHeight.statusBarHeight;
    this.$nextTick(() => {
      uni
        .createSelectorQuery()
        .select(".head")
        .boundingClientRect((data) => {
          this.height = data.height + 29;;
        })
        .exec();
    });
  },
  methods: {
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    getDetail() {
      this.$http
        .helpKefudetail({ id: this.id })
        .then((res) => {
          // console.log(res.data.info, "问题解答");
          this.detail = res.data.info
          
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
  },
};
</script>
    
    <style scoped lang="scss">
.content {
  box-sizing: border-box;
}
.head {
  width: 100%;
  padding: 18rpx 30rpx 47rpx;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 99;
  background: #fff;

  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .head_right {
    position: absolute;
    right: 30rpx;
    display: flex;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #444444;
  }
}
.box {
  padding: 30rpx;
  box-sizing: border-box;
  .box_title {
    font-size: 32rpx;
    color: #444444;
    margin-bottom: 40rpx;
  }
  .box_text {
    font-size: 28rpx;
    color: #444444;
    line-height: 46rpx;
  }
}
</style>